import Fluent

struct CreateSimpleBuilding: Migration {

  func prepare(on database: Database) -> EventLoopFuture<Void> {
    database.schema("simplebuilding")
        .id()
        .field("name", .string)
        .field("height", .double)
        .field("length", .double)
        .field("pitch", .double)
        .field("positionX", .double)
        .field("positionY", .double)
        .field("showFlag", .bool)
        .field("showTextBalloon", .bool)
        .field("width", .double)
        .field("projectID", .uuid, .required, .references("project", "id"))
        .create()
  }
  
  func revert(on database: Database) -> EventLoopFuture<Void> {
    database.schema("simplebuilding").delete()
  }
}
